package sm.hibernate.type;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.type.Type;

public class ArrayType extends AbstractArrayType {

	@Override
	public org.hibernate.type.Type[] getPropertyTypes() {
		return new Type[] { Hibernate.CLOB };
	}

	@Override
	protected String getText(ResultSet rs, String[] names,
			SessionImplementor session, Object owner)
			throws HibernateException, SQLException {
		return (String) Hibernate.TEXT.nullSafeGet(rs, names, session, owner);
	}

	@Override
	protected void setText(PreparedStatement st, Object value, int index,
			SessionImplementor session) throws HibernateException, SQLException {
		Hibernate.TEXT.nullSafeSet(st, value, index, session);
	}

}
